#!/bin/bash

echo "Father Process ID is $$"
localvar="Define a local variable."
echo "localvar=$localvar"

# 定义环境变量并输出
ENVVAR="Define a environment var."
export ENVVAR
echo "ENVVAR=$ENVVAR"

# 调用child.sh脚本，即创建子进程
$PWD/child.sh

# child.sh执行完毕，输出相关变量
echo "Return to Father Process $$"
echo "localvar=$localvar"
echo "ENVVAR=$ENVVAR"
